﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SATF.DB;
using System.Data;

namespace SATF.BI
{
    public class BICaseFile : BaseItem
    {
        #region 所有成员属性

        private UInt64 m_module_id = 0;
        public UInt64 Module_ID
        {
            get { return m_module_id; }
            set
            {
                m_module_id = value;
                OnPropertyChanged("Module_ID");
            }
        }

        private BIModule m_module = null;
        public BIModule Module
        {
            get { return m_module; }
            set
            {
                m_module = value;
                OnPropertyChanged("Module");
            }
        }

        private string m_desc = "";
        public string Desc
        {
            get { return m_desc; }
            set
            {
                m_desc = value;
                OnPropertyChanged("Desc");
            }
        }

        private int m_isdeleted = 0;
        public int Isdeleted
        {
            get { return m_isdeleted; }
            set
            {
                m_isdeleted = value;
                OnPropertyChanged("Isdeleted");
            }
        }


        private string m_moduleName = "";
        public string ModuleName
        {
            get { return m_moduleName; }
            set
            {
                m_moduleName = value;
                OnPropertyChanged("ModuleName");
            }
        }

        private string m_caseFile_path = "";
        public string CaseFile_Path
        {
            get { return m_caseFile_path; }
            set
            {
                m_caseFile_path = value;
                OnPropertyChanged("CaseFile_Path");
            }
        }

        private string m_caseData_path = "";
        public string CaseData_Path
        {
            get { return m_caseData_path; }
            set
            {
                m_caseData_path = value;
                OnPropertyChanged("CaseData_Path");
            }
        }

        private int m_caseCount = 0;
        public int Case_Count
        {
            get { return m_caseCount; }
            set
            {
                m_caseCount = value;
                OnPropertyChanged("Case_Count");
            }
        }


        #endregion


        #region 构造方法

        public BICaseFile()
            : base()
        {

        }

        public BICaseFile(UInt64 id)
            : base(id)
        {

        }

        public BICaseFile(string name)
            : base(name)
        {

        }

        public BICaseFile(DataRow dataRow)
            : base(dataRow)
        {

        }

        #endregion


        #region 基类方法

        public override void SetTableName()
        {
            this.TableName = "casefile";
        }

        public override string GetChildTable()
        {
            return "";
        }

        public override void Fill(System.Data.DataRow dataRow)
        {
            ID = DBConvert.ToUInt64(dataRow, "ID");
            Name = DBConvert.ToString(dataRow, "Name");
            Module_ID = DBConvert.ToUInt64(dataRow, "Module_ID");
            Module = new BIModule(Module_ID);
            ModuleName = Module.Name;
            Desc = DBConvert.ToString(dataRow, "Desc");
            CaseFile_Path = DBConvert.ToString(dataRow, "CaseFile_Path");
            CaseData_Path = DBConvert.ToString(dataRow, "CaseData_Path");
            Case_Count = DBConvert.ToInt32(dataRow, "Case_Count");
            IsDeleted = DBConvert.ToInt32(dataRow, "IsDeleted");

            this.ContentDataRow = dataRow;
        }

        public override void UpdateContentDataRow()
        {
            this.ContentDataRow["Name"] = Name;
            this.ContentDataRow["Module_ID"] = Module_ID;
            this.ContentDataRow["Desc"] = Desc;
            this.ContentDataRow["CaseFile_Path"] = CaseFile_Path;
            this.ContentDataRow["CaseData_Path"] = CaseData_Path;
            this.ContentDataRow["Case_Count"] = Case_Count;
            this.ContentDataRow["IsDeleted"] = IsDeleted;

            this.ContentDataRow = this.ContentDataRow;
        }

        public override IList<BaseItem> GetChildren()
        {
            throw new Exception("The method or operation is not implemented.");
        }

        #endregion


        #region 子类方法


        #endregion


        #region 一些查询方法


        #endregion
    }
}
